package com.example.blog.model;

import java.io.Serializable;

public class Article implements Serializable {
    private int id;
    private String title;
    private String content;
    private String time;
    private int userId;
    private User user;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Article(int id, String title, String content, String time, int userId, User user) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.time = time;
        this.userId = userId;
        this.user = user;
    }

    public Article() {
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", content='" + content + '\'' +
                ", time='" + time + '\'' +
                ", userId=" + userId +
                ", user=" + user +
                '}';
    }



    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public Article(int id, String title, String content, String time, int userId) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.time = time;
        this.userId = userId;
    }
}
